<?php $this->_extends('_layouts/bocib_layout'); ?>

<?php $this->_block('content');?>
<div id="content">
    <h2>现有课程</h2>
    <table class="coursesList">
        <tr>
            <th class="id">id</th>
            <th class="course">课程</th>
            <th class="edit">更新</th>
            <th class="delete">删除</th>
        </tr>
        <?php foreach(Course::find()->all()->query() as $course) { ?>
        <tr>
            <td><?=$course->course_id;?></td>
            <td><?=$course->course;?></td>
            <td><a href="<?=url('bofaculty/editcourse', array('course_id'=>$course->course_id));?>">更新名称</a></td>
            <td><a href="<?=url('bofaculty/deletecourse', array('course_id'=>$course->course_id));?>">删除</a></td>
        </tr>
        <?php } ?>
    </table>
    <form action="<?=url('bofaculty/addcourse');?>" method="post" class="addcourse">
        <div>
            <label for="new_course">添加新课程</label>
            <input type="text" name="new_course" id="new_course" />
            <input type="submit" value="提交" />
        </div>
    </form>
</div>
<?php $this->_endblock('content');?>